package com.selebash;

import com.selebash.features.FeatureHolder;
import com.selebash.scripts.Script;
import java.util.ArrayList;
import java.util.List;

/**
 * @author sad
 */
public class ParserContext {

    private final List<FeatureHolder> features = new ArrayList<FeatureHolder>();
    private List<ParsingError> errors = new ArrayList<ParsingError>();
    private Script currentDocument;

    public Script getCurrentDocument() {
        return currentDocument;
    }

    public void setCurrentDocument(Script currentDocument) {
        this.currentDocument = currentDocument;
    }

    public List<ParsingError> getErrors() {
        return errors;
    }

    public List<FeatureHolder> getFeatures() {
        return features;
    }

    public static class ParsingError {

        private final int start;
        private final int end;
        private final String message;

        public ParsingError(int start, int end, String message) {
            this.start = start;
            this.end = end;
            this.message = message;
        }

        public int getStart() {
            return start;
        }

        public int getEnd() {
            return end;
        }

        public String getMessage() {
            return message;
        }

    }
}
